The present invention relates to a control unit for controlling operational sequences in a vehicle.
German Published Patent Application No. 43 32 499 describes a method for completely reprogramming an electrically erasable, non-volatile memory in a control unit, particularly in a motor-vehicle control unit. Its programming operation is performed without the use of an permanent memory (ROM). In this instance, the erasable, non-volatile memory is divided into at least two separately erasable and programmable sectors, into each of which a programming module can be written in. The division into two sectors enables the entire programming operation to be repeated, in the event a power failure occurs before the programming operation is executed between the motor vehicle and the data terminal. This is possible because the programming module is present, quasi in duplicate, in the programmable, non-volatile memory, thus in each of the two memory sectors. Therefore, even if one of these two programming modules is erased, there is still an intact programming module in the memory as a backup copy. Backup copies must also be continually stored, since a disturbance, such as a power failure, entails a complete reprogramming. Such a reprogramming does not follow automatically, but must be specified externally.
It is apparent that the methods discussed here are not able to provide optimal results in every respect. Thus, sectors rendered incomplete because of a disturbance are not automatically restored. Restoration requires complete, external reprogramming. Therefore, the methods mentioned here require continually storing backup copies of the data and programs in a backup sector. Data and/or programs, worthy of back-up, are duplicated by backups, thus by backup copies, which must be executable. The result is a plurality of erase and programming cycles, which stresses the component containing the memory. The related art, as a rule, requires a multiplicity of steps or commands to reprogram a memory. The result is a relatively long programming code that is not executable, particularly during the copying phases of the backup.
If the copying routine is abnormally terminated during reprogramming, a backup containing the old data and/or programs or routines is then used. Since the backup used in this context includes all data and/or programs worthy of back-up, the code that must be executed in the event of an abnormal termination is relatively large. For that reason, depending on the size of the sector of the data and/or programs worthy of backup, known methods heretofore require a relatively large working man memory (RAM), for example, to execute the programming routine of this backup-worthy sector. Additional sources of error arise when a modifiable block of memory, containing the computer system""s start programs (xe2x80x9cboot blockxe2x80x9d), is used in this context as a programming environment which decides whether the old or new data sector and/or programming sector are executed at the moment.
Before a program or its backup copy is executed, a test can be performed to check for any existing data errors in the programming code. Many varied methods are known for identifying data errors, for example in the case of faulty memory or programming operations. For this, the data and/or programs must be represented in an error code, i.e., an error detection code, which, in addition to the actual information, also contains redundant information for purposes of identifying errors. Such information can be, for example, parity bits, which permit error detection through checksum operations, such as horizontal sum and/or longitudinal sum operations (even parity check). Other linearly and/or cyclically executable test methods are known, which include the Hamming code, the BCH code (Bose, Chandhuri, Hocquenghem) and the Abramson code. Also numbering among these test methods is the cyclic redundancy check (CRC), where test bytes are generated block by block, precisely in accordance with the CRC method, from the data and/or programs, thus from the information to be erased and/or copied and/or to be read in, and are then processed or recorded with this information. In addition to error detection, some of these methods even provide for error correction.
In the present invention, the original sector of the backup-worthy data and/or programs is advantageously not erased in response to an erase command. Therefore, the programming code used for reprogramming is retained. Erased instead is that sector which normally would contain the copy of the backup-worthy data and/or programs, thus the backup. As a further benefit, this sector is used as an intermediate memory for the new data and/or programs, worthy of backup, that do not need to be executable there. In this context, backup-worthy data and/or programs are understood to be those whose loss or faulty nature would no longer permit the memory to be reprogrammed or the memory contents to be later modified, or no longer allow the computer system to be used for its intended purpose, for example to control operational sequences in a vehicle.
Thus, the part of the data stream intended for the backup-worthy sector is advantageously redirected during programming into that data memory sector, which is used as an intermediate memory and which had been erased beforehand for this purpose.
An optimized small routine (RAM routine RR), located in the working memory, is then used to copy the new sector from the intermediate memory over to the old, previously undeleted sector. Last of all, the intermediate memory is erased, for example, by the RAM routine RR or by a program of the new backup-worthy data and/or programs. As a result, other data and/or programs can finally be written into the memory area used as the intermediate memory.
Therefore, to delete the sector which initiates the process, the method advantageously requires only one single erase command. The erase command is not dependent on whether backup-worthy data are contained in the sector to be erased or not. Thus, the new program code or the new data are automatically programmed in one single step.
It is beneficial that the backup-worthy memory sector is available during the entire reprogramming time, i.e., the time, during which no executable programming code is present in the backup-worthy sector, is minimized, since the backup-worthy data and/or programs are always located in the corresponding memory area.
Another beneficial result derived here is that there is no need to store the extensive programming routines of the backup-worthy data and/or programs in the working memory. The small, optimized RAM routine located in the working memory merely copies the new, backup-worthy data and/or programs over the old ones. Therefore, a further benefit is that only one small working memory is needed, i.e., little working memory capacity is loaded. If an abnormal termination occurs during RAM routine activity, then a boot block having a fixed configuration, can complete this operation using its own copying routine. This advantageously minimizes the size of the programming code, which is executed in the event of an abnormal termination.
Also advantageous is the fact that the boot block, which is able to have a fixed configuration in a non-erasable or non-writable memory sector, and does not decide which memory area is executed with old or new data and/or programs, but rather, if indicated, copies the new programming code over the old original and executes this again in the original sector. As a result, the routines or programs of the backup-worthy data and/or programs are located at all times in the original memory sectors intended for them in the first place. This minimizes the potential for errors. This procedure also eliminates the need for an executable backup. This means that, even in the case of an abnormal termination of the programming, there is advantageously no need to backup the old data and/or programs. The existing new data and/or programs can be copied, instead, from the boot block into the target sector, thus into the original sector.